# -*- coding: utf-8 -*-
'''
@文件    :__init__.py
@说明    :
@时间    :2025/07/17 23:03:08
@作者    :浪晋
@版本    :1.0
'''
from fastapi import FastAPI


def create_app() ->FastAPI:
    """FastAPI工厂函数"""
    from app.settings.config import config
    from app.core import register, event
    app = FastAPI(
        lifespan=event.lifespan,
        **config.FASTAPI_CONFIG
    )
    register.app_exceptions(app)
    register.app_middlewares(app)
    register.api_routers(app)
    register.file_mounts(app)
    register.api_docs(app)
    return app